package com.ssm.test;

import com.ssm.pojo.Email;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyMail {

    public static void main(String[] args) {
        MyMail.testSendMail();
    }
    public static void testSendMail() {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-smtp-mail.xml");
        Email mail = (Email)context.getBean("simpleMail");
        mail.sendMail("哈哈", "哈哈哈", "zxg1992623@163.com");
        //mail.sendMail("标题", "内容", "收件人邮箱");
        mail.sendSimpleMail("hello", "hello world,程序如此简单", "zxg1992623@163.com");
    }


}
